Macromedia XML News Aggregator Web Service Sample Application and Source File
The Macromedia XML News Aggregator (MXNA) Web Service Application is a sample application built in Flash MX Professional 2004. It uses the MXNA web service API to provide a simple interface for quickly viewing and reading weblog feeds and posts aggregated by the MXNA. Here is the application in action:
Requirements
Macromedia Flash MX Professional 2004
Sample Files
mxna_app.zip (451 KB)
The application is built using ActionScript 2.0 and the web services classes included with Flash MX Professional 2004. I’ve completely commented the source code for the application so you can easily dissect and learn from the application.
Here is some information to prepare you to work with the code.
Using the Web Services Classes
The application requires the web services classes included with Flash MX Professional 2004. To use these classes, you must manually include them within your library. The MXNA application’s library already contains the web services classes, however, for future reference, here are the steps to place it within your library:
- From within Flash MX Professional 2004 open Window > Other Panels > Common Libraries > Classes
- Drag the WebServicesClasses symbol from the library onto the Stage.
- Delete the WebServicesClasses symbol.
This places the class in your library, making it available for use at runtime.
Finding the ActionScript
When you open the application FLA file, you will notice that there is no ActionScript included within the FLA. All of the ActionScript for the application is held in external classes that are linked to symbols within the library.
To view the linkage and class for each symbol:
- Open the library for the application (Window > Library).
- Open the MXNAApp folder within the library. This contains all of the class symbols of the application.
- Right-click the MXNAApp\MXNAAppController symbol. This is the symbol that represents the controller for the application.
Figure 1. Linkage Properties dialog box for MXNAAppController symbol
Notice the section titled AS 2.0 Class, which has a value of com.macromedia.mxna.app.MXNAAppController. This specifies that the symbol is associated with the specified class. (If you look in your file system, you can find the class in the com/macromedia/mxna.app/MXNAAppController.as file.)
Figure 2. Class layout in the file system
As soon as the Flash Player loads the MXNAAppController symbol, it will also automatically load the MXNAAppController class and associate it with that symbol.
Additional Resources
- ActionScript Articles and Tutorials (Flash Developer Center)
- Components Articles and Tutorials (Flash Developer Center)
- Getting a Handle on Web Services in Flash MX Professional 2004
- Macromedia XML News Aggregator Web Services API
About the author
Mike received his Masters in International Economics and European Studies from the John Hopkins School of Advanced International Studies (SAIS) in 1998.